/**
 */
package org.autosar.schema.r4.impl;

import java.util.Collection;

import org.autosar.schema.r4.EVENTGROUPSTYPE;
import org.autosar.schema.r4.EVENTGROUPTYPE;
import org.autosar.schema.r4.R4Package;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>EVENTGROUPSTYPE</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.autosar.schema.r4.impl.EVENTGROUPSTYPEImpl#getEVENTGROUP <em>EVENTGROUP</em>}</li>
 * </ul>
 *
 * @generated
 */
public class EVENTGROUPSTYPEImpl extends MinimalEObjectImpl.Container implements EVENTGROUPSTYPE {
	/**
	 * The cached value of the '{@link #getEVENTGROUP() <em>EVENTGROUP</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEVENTGROUP()
	 * @generated
	 * @ordered
	 */
	protected EList<EVENTGROUPTYPE> eVENTGROUP;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EVENTGROUPSTYPEImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return R4Package.Literals.EVENTGROUPSTYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<EVENTGROUPTYPE> getEVENTGROUP() {
		if (eVENTGROUP == null) {
			eVENTGROUP = new EObjectContainmentEList<EVENTGROUPTYPE>(EVENTGROUPTYPE.class, this, R4Package.EVENTGROUPSTYPE__EVENTGROUP);
		}
		return eVENTGROUP;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case R4Package.EVENTGROUPSTYPE__EVENTGROUP:
				return ((InternalEList<?>)getEVENTGROUP()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case R4Package.EVENTGROUPSTYPE__EVENTGROUP:
				return getEVENTGROUP();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case R4Package.EVENTGROUPSTYPE__EVENTGROUP:
				getEVENTGROUP().clear();
				getEVENTGROUP().addAll((Collection<? extends EVENTGROUPTYPE>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case R4Package.EVENTGROUPSTYPE__EVENTGROUP:
				getEVENTGROUP().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case R4Package.EVENTGROUPSTYPE__EVENTGROUP:
				return eVENTGROUP != null && !eVENTGROUP.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //EVENTGROUPSTYPEImpl
